<!DOCTYPE html>
<html>

	<head>
		<meta charset="UTF-8">
		<title>sentox-Menu</title>
		<link type="text/css" rel="stylesheet" href="../css/themes/sentox/easyui.css" />
		<link type="text/css" rel="stylesheet" href="../css/themes/sentox/font-awesome.min.css">

		<script type="text/javascript" src="../js/jquery-1.9.1.min.js"></script>
		<script type="text/javascript" src="../js/jquery.easyui.min.js"></script>
	</head>

	<body style="margin:10px;">
		<h2>Menu Events</h2>
		<p>Right click on page to display menu and click an item.</p>
		<div style="margin:20px 0;"></div>
		<div id="mm" class="easyui-menu" data-options="onClick:menuHandler" style="width:120px;">
			<div data-options="name:'new',iconCls:'fa fa-file-text'">New</div>
			<div data-options="name:'save',iconCls:'fa fa-save'">Save</div>
			<div data-options="name:'print',iconCls:'fa fa-print'">Print</div>
			<div class="menu-sep"></div>
			<div data-options="name:'exit'">Exit</div>
		</div>
		<div id="log" class="easyui-panel" title="Event Log" style="height:250px;padding:10px">
		</div>
		<script>
			function menuHandler(item){
				$('#log').prepend('<p>Click Item: '+item.name+'</p>');
			}
			$(function(){
				$(document).bind('contextmenu',function(e){
					e.preventDefault();
					$('#mm').menu('show', {
						left: e.pageX,
						top: e.pageY
					});
				});
			});
		</script>
	</body>

</html>